package com.hongtao3.hsync.vo;

import java.io.File;
import java.io.Serializable;

import org.json.JSONException;
import org.json.JSONObject;

public class Meta implements Serializable{
	 private static final long serialVersionUID = 1L;
	 
	 public Meta(){}
	 
	 public Meta(JSONObject o){
		 try {
			this.path=o.getString("path");
			this.type=o.getString("type");
			this.md5=o.getString("md5");
			this.ct=o.getLong("ct");
			this.mt=o.getLong("mt");
			this.size=o.getLong("size");
			this.client_time=o.getLong("client_time");
			this.request_time=o.getLong("request_time");
		} catch (JSONException e) {
			e.printStackTrace();
		}
	 }
	 
    public String getPath() {
		return path;
	}
	public void setPath(String path) {
		this.path = path;
	}
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	public String getMd5() {
		return md5;
	}
	public void setMd5(String md5) {
		this.md5 = md5;
	}
	public long getCt() {
		return ct;
	}
	public void setCt(long ct) {
		this.ct = ct;
	}
	public long getMt() {
		return mt;
	}
	public void setMt(long mt) {
		this.mt = mt;
	}
	public long getSize() {
		return size;
	}
	public void setSize(long size) {
		this.size = size;
	}
	public long getClient_time() {
		return client_time;
	}
	public void setClient_time(long client_time) {
		this.client_time = client_time;
	}
	public long getRequest_time() {
		return request_time;
	}
	public void setRequest_time(long request_time) {
		this.request_time = request_time;
	}
	
	public String getName(){
		String[] s=path.replace("[/\\]$", "").split("[/\\\\]");
		System.out.println(s[s.length-1]);
		return s[s.length-1];
	}
	
  private String path;
  private String type;
  private String md5;
  private long ct;
  private long mt;
  private long size;
  private long client_time;
  private long request_time;
}
